-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Re-initialize objsets when feature@project_quota is enabled #17999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Re-initialize objsets when feature@project_quota is enabled #17999
Conversation
|
|
||
| error = spa_prop_set(spa, props); | ||
|
|
||
| if ((error == 0) && nvlist_exists(props, "feature@project_quota")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature@project_quota is hard coded though I am not sure if I should write a function to get the name from SPA_FEATURE_PROJECT_QUOTA just to be used here.
fcef7f1 to
63dd016
Compare
069fac4 to
6c302ac
Compare
Addresses the issue of project quotas not being usable after pool upgrade coming from an older version which does not support project quotas to the one that does, similarly to how it was solved for user quotas back in the day with `zfs set version=current` -- when feature@project_quota is first enabled, re-initialize the pool's objsets. Signed-off-by: Dušan Gvozdenović <[email protected]> Closes openzfs#17955
6c302ac to
3566fc6
Compare
|
I gave I re-ran the same test with this PR and expected to see |
- Fix RAID-Z expansion progress reporting > 100% (openzfs#18103). - Rename getextmntent to zfs_getextmntent to avoid libc conflict (openzfs#17887). - Fix Project Quota initialization on upgrade (openzfs#17955, openzfs#17999) by refreshing dnode initialization when feature is enabled.
- Fix RAID-Z expansion progress reporting > 100% (openzfs#18103). - Rename getextmntent to zfs_getextmntent to avoid libc conflict (openzfs#17887). - Fix Project Quota initialization on upgrade (openzfs#17955, openzfs#17999) by refreshing dnode initialization when feature is enabled. closes alek-p/openzfs #21
Motivation and Context
When upgrading from an older version of ZFS which does not have project quotas to a version of OpenZFS which does, after a zpool upgrade, the feature remains enabled but not active and project operations fail with
ENOTSUP, rendering it unusable until a given objset is re-opened.This was observed with an upgrade from ZoL 0.7.1 to OpenZFS 2.3.
Fixes #17955
Description
dmu_objset_open_impl(), if project quotas are present on the pool, a dnode is allocated to hold/refer to the projectused ZAP object and assigned to an in-memory objset fieldos_projectused_dnode.os_projectused_dnodeis used to decide whether project quotas are enabled for a given objset.os_projectused_dnode == NULL. For this reasondmu_objset_projectquota_enabled()will always be false, and actual upgrade will not happen until the objset is re-opened.It seems like a similar issue has been happening with user quotas back in the day and the solution was to suspend and resume the affected file systems in order to re-initialize the affected object sets (see
zfs_prop_set_special()→zfs_ioc_userspace_upgrade()). So analogously, we suspend+resume all the pool's affected file systems to re-initialize their associated object sets whenfeature@project_quotais set andos_projectused_dnodeisNULL.How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by.